import request from '@/utils/request'

enum API {
  GETUSERINFO_URL = '/acl/paginateduserinfolist',
  ADDUSERINFO_URL = '/acl/adduserinfo',
  UPDATEUSERINFO_URL = '/acl/updateuserinfo',
  DELETEUSERINFO_URL = '/acl/deleteuserinfo',
  SEARCHBYID_URL = '/acl/searchbyid'
}

//获取用户信息
export const reqUserInfoList = (page:number,limit:number,inputName:string) =>
  request.get<any, any>(`${API.GETUSERINFO_URL}?page=${page}&limit=${limit}&name=${inputName}`)
//增加用户信息
export const addUserInfo = (params: any) =>
  request.post<any, any>(API.ADDUSERINFO_URL, params, {
    headers: { 'Content-Type': 'multipart/form-data' },
  })
//修改用户信息
export const updateuserinfo = (params: any) =>
  request.post<any, any>(API.UPDATEUSERINFO_URL, params, {
    headers: { 'Content-Type': 'multipart/form-data' },
  })
//删除用户信息
export const deleteuserinfo = (id: any) =>
  request.delete<any, any>(`${API.DELETEUSERINFO_URL}?${id}`)
//查找用户信息
export const searchUserinfobyid = (_id: any) =>
  request.get<any, any>(`${API.SEARCHBYID_URL}?_id=${_id}`)
